Accessing the API
Sign Up as Facility User
Start by signing up as a Facility User.
Email and Password
- Navigate to the signup page using the appropriate link for your environment.
- Enter your email address.
- Create a password. Ensure your password meets the following criteria:
- At least 8 characters.
- Includes at least 3 of the following:
- lowercase letters (a-z),
- uppercase letters (A-Z),
- numbers (0-9)
- special characters (e.g., !@#$%^&*).
Click the "I Manage a Facility" Button
Once you log in, you will be redirected to a page where you need to click the "I manage a facility" button.
Enter Your First and Last Name
- Fill in your first name.
- Fill in your last name.
Enter Your Phone Number
- Enter your phone number in the designated field.
Review and Accept Terms and Conditions
- Carefully read through the terms and conditions.
- Check the box to acknowledge that you have read and understood them.
Complete the Sign-Up Process
- After accepting the terms and conditions, click the "Continue" button.
You will be redirected to the facilities page
With this, you have successfully signed up as a Facility User.
Register your application in the Developer Portal
Once you have signed up as a Facility User, you can register your application in the Developer Portal
Register new Application
Fill in the Application Details
Authorization Code Flow
Review the authorization code flow to understand how to obtain the token.
Auth Base URL
Since Nursa provides two environments for third-party integrators, make sure to use the correct URL to connect to the Nursa Authorization Server:
- Production: https://auth.nursa.com/
- Sandbox: https://auth.sandbox.nursa.com
Audience URL
- Production: https://public-api.prod.nursa.com/
- Sandbox: https://public-api.sandbox.nursa.com/
Example with Replacements
Replace {clientId}
, {scopes}
, and {redirectUri}
with your actual values:
<!DOCTYPE html>
<html>
<head>
<title>Redirect Button</title>
</head>
<body>
<button onclick="redirectToAuth()">Redirect</button>
<script>
function redirectToAuth() {
const authBaseUrl = "https://auth.sandbox.nursa.com";
const clientId = "yourClientId";
const scopes = "yourScopes";
const redirectUri = "yourRedirectUri";
const authUrl = `https://${authBaseUrl}/oidc/authorize?client_id=${clientId}&scope=${scopes}&redirect_uri=${redirectUri}&audience=https%3A%2F%2Fpublic-api.sandbox.nursa.com%2F&response_type=code&response_mode=query`;
window.location.href = authUrl;
}
</script>
</body>
</html>
Steps to Follow
- When the user clicks the "Redirect" button, they will be redirected to the authorization server’s login page.
- The user logs in and grants the requested permissions.
- After granting permissions, the authorization server redirects the user to the specified
redirect_uri
with an authorization code. - The client application then exchanges the authorization code for an access token by making a request to the token endpoint.